import request from "@/utils/axios";

/** 登录接口 POST /api/approval */
export async function create(body: WORKFLOW.ApprovalArg, options?: { [p: string]: any }) {
    return request<WORKFLOW.ApprovalArg>('/api/approval', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}

/** 此处后端没有提供注释 GET /api/approval-list **/
export async function getApproval(id: string,options?: { [key: string]: any }) {
    return request<WORKFLOW.ApprovalArg>(`/api/approval/${id}`, {
        method: 'GET',
        ...(options || {}),
    });
}
/** 此处后端没有提供注释 GET /api/approval-list **/
export async function getApprovalList(id:string,options?: { [key: string]: any }) {
    return request<WORKFLOW.ApprovalArg>(`/api/approval/list/${id}`, {
        method: 'GET',
        ...(options || {}),
    });
}

/** 此处后端没有提供注释 GET /api/approval-list **/
export async function handleApproval(body:WORKFLOW.HandleParam, options?: { [key: string]: any }) {
    return request<WORKFLOW.ApprovalArg>(`/api/approval/handle-approval`, {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        data: body,
        ...(options || {}),
    });
}
